// Helper class for models dealing with recievers
// Copyright 2004 (C) Ralph Thomas

#ifndef RECEIVER_HELPER_H
#define RECEIVER_HELPER_H

#include <model/receiver.h>
#include <boost/shared_ptr.hpp>

namespace model {
	class rhImpl;
	class receiverHelper {
		boost::shared_ptr<rhImpl> _impl;
	  public:
		//
		// receiverHelper()
		//
		/// Create a new receiverHelper.
		//
		receiverHelper();
		//
		// ~receiverHelper()
		//
		/// Virtual destructor.
		//
		virtual ~receiverHelper();
		//
		// void subscribe( receiver* r )
		//
		/// Add the specified receiver to the list of receivers, and
		/// associcate it with the given mask.
		///
		/// \param	r		the reciever to add to the list.
		//
		void subscribe( receiver* r );
		//
		// void unsubscribe( const receiver* r )
		//
		/// Make sure that the given receiver never receives any
		/// notifications again.
		///
		/// \param	r	the receiver to remove from the list.
		//
		void unsubscribe( const receiver* r );
		//
		// from model/receiver.h
		//
		void notify( const model* m, const std::string& attrName );
	};
};
#endif
